<?php

declare (strict_types=1);
namespace App\Model;


use Hyperf\Database\Model\Relations\HasMany;

class User extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'users';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $guarded = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    public function device():HasMany
    {
        return $this->hasMany(Device::class, 'user_id', 'id');
    }

}
